import config from "@/config";
import http from "@/utils/request";

export default {
  dic: {
    tree: {
      url: `${config.API_URL}/system/dic/tree`,
      name: "获取字典树",
      get: async function () {
        return await http.get(this.url);
      },
    },
    list: {
      url: `${config.API_URL}/system/dic/list`,
      name: "字典明细",
      get: async function (params) {
        return await http.get(this.url, params);
      },
    },

    get: {
      url: `${config.API_URL}/Config/GetConfigListByConfigTypeNo`,
      name: "获取字典数据",
      get: async function (params) {
        return await http.get(this.url, params);
      },
    },
  },
  dicts: {
    deleteConfig: {
      url: `${config.API_URL}/Config/deleteConfig`,
      name: "数据字典-添加",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    AddConfig: {
      url: `${config.API_URL}/Config/AddConfig`,
      name: "数据字典-添加",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    UpdateConfig: {
      url: `${config.API_URL}/Config/UpdateConfig`,
      name: "数据字典-添加",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    addConfigType: {
      url: `${config.API_URL}/ConfigType/addConfigType`,
      name: "数据字典新增",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    deleteConfigType: {
      url: `${config.API_URL}/ConfigType/deleteConfigType`,
      name: "数据字典-删除",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    updateConfigType: {
      url: `${config.API_URL}/ConfigType/updateConfigType`,
      name: "数据字典更新",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },

    GetConfigTree: {
      url: `${config.API_URL}/Config/GetConfigTree`,
      name: "用户列表",
      get: async function (params) {
        return await http.get(this.url, params);
      },
    },
    GetConfigTypeList: {
      url: `${config.API_URL}/ConfigType/GetConfigTypeList`,
      name: "获取字典分类",
      get: async function () {
        return await http.get(this.url);
      },
    },
  },
  role: {
    GetRolePages: {
      url: `${config.API_URL}/Role/GetRolePages`,
      name: "角色列表",
      get: async function (params) {
        return await http.get(this.url, params);
      },
    },
    GetRoleMenuList: {
      url: `${config.API_URL}/RoleMenu/GetRoleMenuList`,
      name: "角色列表-菜单列表",
      get: async function (params) {
        return await http.get(this.url, params);
      },
    },

    getUserTypePages: {
      url: `${config.API_URL}/UserType/getUserTypePages`,
      name: "角色列表-角色类型",
      get: async function (params) {
        return await http.get(this.url, params);
      },
    },
    addRoleInfo: {
      url: `${config.API_URL}/Role/addRoleInfo`,
      name: "角色列表-新增",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    DeleteInfo: {
      url: `${config.API_URL}/Role/DeleteInfo`,
      name: "角色列表-删除",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    AddRoleMenu: {
      url: `${config.API_URL}/RoleMenu/AddRoleMenu`,
      name: "角色列表-菜单权限-新增",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    UpdateRoleState: {
      url: `${config.API_URL}/Role/UpdateRoleState`,
      name: "角色列表-开关",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
  },
  dept: {
    DeleteInfo: {
      url: `${config.API_URL}/Department/DeleteInfo`,
      name: "部门删除",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },

    UpdateDepartmentInfo: {
      url: `${config.API_URL}/Department/UpdateDepartmentInfo`,
      name: "部门编辑",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },

    AddDepartmentInfo: {
      url: `${config.API_URL}/Department/AddDepartmentInfo`,
      name: "部门新增",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    GetDepartmentPages: {
      url: `${config.API_URL}/Department/GetDepartmentPages`,
      name: "部门管理列表tree",
      get: async function (params) {
        return await http.get(this.url, params);
      },
    },
  },
  user: {
    DeleteUser: {
      url: `${config.API_URL}/User/DeleteUser`,
      name: "用户列表-删除",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    AddSystemUser: {
      url: `${config.API_URL}/User/AddSystemUser`,
      name: "用户列表-新增",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    UpdateSystemUser: {
      url: `${config.API_URL}/User/UpdateSystemUser`,
      name: "用户列表-编辑",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },

    GetDepartmentList: {
      url: `${config.API_URL}/Department/GetDepartmentList`,
      name: "用户列表-部门",
      get: async function (params) {
        return await http.get(this.url, params);
      },
    },
    GetUserPageList: {
      url: `${config.API_URL}/User/GetUserPageList`,
      name: "用户列表",
      get: async function (params) {
        return await http.get(this.url, params);
      },
    },
  },
  menu: {
    DeleteInfo: {
      url: `${config.API_URL}/Menu/DeleteInfo`,
      name: "菜单列表",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    GetMenuList: {
      url: `${config.API_URL}/Menu/GetMenuList`,
      name: "菜单列表",
      get: async function (params) {
        return await http.get(this.url, params);
      },
    },
    AddMenuInfo: {
      url: `${config.API_URL}/Menu/AddMenuInfo`,
      name: "新增菜单",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    UpdateMenuInfo: {
      url: `${config.API_URL}/Menu/UpdateMenuInfo`,
      name: "更新菜单",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
  },
  login: {
    Login: {
      url: `${config.API_URL}/Authorize/Login`,
      name: "登录",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
    GetUserById: {
      url: `${config.API_URL}/User/GetUserById`,
      name: "用户信息",
      get: async function (params) {
        return await http.get(this.url, params);
      },
    },
    GetMenuRole: {
      url: `${config.API_URL}/RoleMenu/GetMenuRole`,
      name: "路由信息",
      post: async function (data, config = {}) {
        return await http.post(this.url, data, config);
      },
    },
  },
};
